
using UnityEngine;
using UnityEngine.UI;

public class ShopUI_Buttons : MonoBehaviour
{
    private ShopUI_Manager manager;
    private Button[] buttons;
    private void Start()
    {
        manager = GetComponentInParent<ShopUI_Manager>();
        buttons = GetComponentsInChildren<Button>();
        buttons[0].onClick.AddListener(OnRevokeAll);
        buttons[1].onClick.AddListener(OnCompleteDeal);
    }

    private void OnRevokeAll()
    {
        manager.Container.RevokeAll();
        manager.Box.Information = TextTool.Wrap(manager.Data.Revoke, 10);
    }

    private void OnCompleteDeal()
    {
        manager.Container.CompleteDeal();
        manager.Box.Information = TextTool.Wrap(manager.Data.CompleteDeal, 10);
    }
}
